/**
 *
 */
package gemini.basic.batch;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * Class to wrap SchedulerFactoryBean and set itself to service beans.
 *
 */
public class GmnSchedulerFactoryBean extends SchedulerFactoryBean {

    private ApplicationContext applicationContext;

    /**
     * @return the appContext
     */
    public ApplicationContext getApplicationContext() {
        return applicationContext;

    }
    /**
     * @param appContext the appContext to set
     */
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }


    /**
     * {@inheritDoc}
     */
    protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName)
            throws SchedulerException {
        Scheduler scheduler = super.createScheduler(schedulerFactory, schedulerName);
        return scheduler;
    }

}
